/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-11-08     Administrator       the first version
 */


#include <stdint.h>
#include <rthw.h>
#include <rtthread.h>
#include <rtdevice.h>
#include <string.h>
#include <board.h>
//#define  a


#ifdef  a

/* 将菜单的属性和操作"封装"在一起*/
typedef struct tagSysMenu
 {
 char *text;            /* 菜单的文本 */
 BYTE xPos;             /* 菜单在LCD上的x坐标 */
 BYTE yPos;             /* 菜单在LCD上的y坐标 */
 void (*onOkFun)();     /* 在该菜单上按下ok键的处理函数指针 */
 void (*onCancelFun)();  /* 在该菜单上按下cancel键的处理函数指针 */
}SysMenu, *LPSysMenu;

static SysMenu menu[MENU_NUM] =
 {
   {  "menu1", 0, 48, menu1OnOk, menu1OnCancel } ,
   {  " menu2", 7, 48, menu2OnOk, menu2OnCancel } ,
   {  " menu3", 7, 48, menu3OnOk, menu3OnCancel } ,
   {  " menu4", 7, 48, menu4OnOk, menu4OnCancel },

};

/*
   ssd1306_Fill(Black);
   ssd1306_SetCursor(40, 0);
   ssd1306_WriteString("MENUE", Font_11x18, White);
   ssd1306_SetCursor(22, 18);
   ssd1306_WriteString("select 1", Font_11x18, White);
   ssd1306_SetCursor(22, 36);
   ssd1306_WriteString("select 2", Font_11x18, White);
   ssd1306_SetCursor(2, 18*i+18);
   ssd1306_WriteString("->", Font_11x18, White);
   ssd1306_UpdateScreen();
   */
/* 按下OK键 */
 void onOkKey()
 { menu[currentFocusMenu].onOkFun(); }

 /* 按下Cancel键 */
 void onCancelKey()
 { menu[currentFocusMenu].onCancelFun(); }



#endif
